package com.lvtu.monitor.utils;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/** 
 * @Title: ThreadPoolUtils.java 
 * @Package com.lvtu.monitor.utils 
 * @Description: TODO 
 * @author dengcheng 
 * @date 2015-5-22 下午1:32:08 
 * @version V1.0.0 
 */
public class ThreadPoolUtils {
	private static volatile ThreadPoolUtils instance;
	
	protected ThreadPoolExecutor threadPoolExecutor;
	
	public ThreadPoolUtils(){
		 if (this.threadPoolExecutor == null) {
	            this.threadPoolExecutor =
	                    new ThreadPoolExecutor(200, Integer.MAX_VALUE, 5 * 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
	        }
		
	}
	public static ThreadPoolUtils getInstance() {
		if (instance == null) {
			synchronized (ThreadPoolUtils.class) {
				if(instance==null){					
					instance = new ThreadPoolUtils();
				}
			}
		}
		return instance;
	}
	public ThreadPoolExecutor getThreadPoolExecutor() {
		return threadPoolExecutor;
	}
}
